﻿@{
    ViewBag.Title = "Login";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}


@section Header
{
    <link href="../../css/bootstrap.min.css" rel="stylesheet" />
    <link href="../../css/style.css" rel="stylesheet" />
    <link href="../../css/font-awesome.min.css" rel="stylesheet" />
    <script type="text/javascript">
        function submit() {
            //验证输入
            if ($("#txt_UserName").validatebox('isValid') == false) { return; }
            if ($("#txt_Password").validatebox('isValid') == false) { return; }

            //参数对象
            var user = { UserName: $("#txt_UserName").val(), Password: $("#txt_Password").val() };

            $.post("/AdminLogin/CheckLogin/", user,
                    function (data, textStatus) {
                        if (data == 'success') { window.location.href = "/Admin/Index/"; }
                        else { $.messager.alert('失败', '登录失败，请检查用户名密码，' + data, 'error'); }
                    }
                  );
        }

    </script>
}

<body class="login-page">
    <div class="login-form">
        <div class="login-content">
            <div>
                <h2 style="background: #373e4a; color: #FFFFFF; ">金鼎云艺术网站后台</h2>
            </div>
            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-user"></i>
                    </div>

                    @Html.TextBox("txt_UserName", null, new
               {
                   size = 20,
                   @class = "easyui-validatebox",
                   required = "true"
               })
                </div>
            </div>

            <div class="form-group">
                <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-key"></i>
                    </div>

                    @Html.TextBox("txt_Password", null, new
               {
                   size = 20,
                   @class = "easyui-validatebox",
                   required = "true",
                   type = "password"
               })
                </div>
            </div>

            <div class="form-group">
                <button type="button" value="登录" onclick="submit()" class="btn btn-primary btn-block btn-login">
                    <i class="fa fa-sign-in"></i>
                    Login In
                </button>
            </div>
        </div>
    </div>
</body>
